﻿
<!--#include file="Conn.asp"-->
<%Response.CacheControl="no-cache"
Response.Buffer=False%>
<html>
<head>
<title>欢迎光临学习资料查询系统</title>
<link href="css/ponts_common.css" rel="stylesheet" type="text/css"/> 
<link href="css/bj_common.css" rel="stylesheet" type="text/css"/> 
<link href="css/bj_others.css" rel="stylesheet" type="text/css"/> 

<meta http-equiv="Content-Type" content="text/html"; charset="GBK">

</head>
<body onLoad="MM_preloadImages('images/background2.jpg')">
<div class="com_1"><img src="images/42.jpg" alt="1"  border="0" align="middle"/></div>
      <div class="com_2">
       <div class="com_2_1">
   		 <span title="首 页" class="com_2_1_2"><a href="index.asp"  class="headline">首 页</a></span>
    	 <span title="资料查询" class="com_2_1_1"><a href="quest.asp"  class="headline">资料查询</a></span>
   		 <span title="资料共享" class="com_2_1_1"><a href="Uploaduser.asp"  class="headline">资料共享</a></span>
 	     <span title="资料求助" class="com_2_1_1"><a href="seeking.asp" class="headline">资料求助</a></span>
  	     <span title="个人中心" class="com_2_1_1"><a href="memcenter.asp" class="headline">个人中心</a></span>
        </div>
      </div> 
         
      <div class="com_3">    
              <div class="com_3_1">
               <% 
				    dim username
						  username=session("username")
 			if username<>"" then 
			 response.Write("<table><tr valign=top><td>"&"&nbsp;"&"</td></tr>")
			 response.Write("<tr><td  width=74 class=ti align=right>")
			 response.Write("你好!</td><td>"&username&"")
			 response.Write("</td></tr></table>")
	 		else 
            response.Write("<table><tr  valign=top>")
			response.Write("<td><p class=ti>"&"用户登录&amp;注册"&"</p>")
            response.Write("<form action=chklogin.asp method=post name=longform>")   
			response.Write("<table><tr valign=top align=center><td width=74>")
			response.Write("用户名</td>")
			response.Write("<td width=170>")
			response.Write("<input name=passname type=text maxlength=20 size=20>")
			response.Write("</td></tr><tr valign=top align=center><td>")
			response.Write("密码</td>")
     		response.Write("<td><input name=password type=password maxlength=18 size=20></td></tr><tr valign=middle align=center>")
			response.Write("<td colspan=2>   <input name=submit type=submit value=登录 size=2>")
			response.Write(" &nbsp; &nbsp;&nbsp; "&"<a href=Reg.asp class=black>" &"注册 "&"</a>")		
			response.Write("</td></tr></table></form></td></tr></table>")
	 end if
				%>
                </div>
            <div class="com_3_2">
              <div class="quest_1">
                 		<form action="questget.asp" method="get">
                        <table>
                   <tr valign="middle">
                   	<td width="100" class="ti">搜索:</td>
                        <td width="300" align="left"><input type="text" maxlength="30" name="questname" size="60"></td>
                       <td width="76" align="left"><input type="submit" name="quest" value="查询">  </td>
                   </tr>
                    <tr>
                       <td></td>
                       <td colspan="3">
			<input type="radio" name="lm" value="all" checked="" id="all"/>全部
			<input type="radio" name="lm" value="dz"/>地址
			<input type="radio" name="lm" value="lj"/>链接
   		    <input type="radio" name="lm" value="wj"/>文件
                       </td>
                   </tr>
                   </table>
                   </form>
                        </div> 
 <%
 userip = Request.ServerVariables("HTTP_X_FORWARDED_FOR") 
 if userip = "" Then 
   userip = Request.ServerVariables("REMOTE_ADDR") 
end if
fileid=Request.QueryString("fileid")
replace fileid,Chr("39"),Chr("39")+Chr("39")
set Rs=Server.CreateObject("adodb.Recordset")
'sql="Exec Getfromresource '"&fileid&"'"
sql="Select * From resource Where fileid='"&fileid&"'"
Rs.open sql,Conn,1,1
 filename=Rs("filename")
 subject=Rs("subject")
 uploaduser=Rs("uploaduser")
 uploadtime=Rs("uploadtime")
 viewtimes=Rs("viewtimes")
 filedesc=Rs("filedesc")
 filetype=Rs("filetype")
 filelocation=Rs("filelocation")
 Rs.close                 
 sql="SELECT subjectnum FROM lessonifo WHERE subject ='"&subject&"'"
 Rs.open sql,Conn,1,1
 subjectnum=Rs("subjectnum")
 Rs.close
 if session(userip)<>1 then
     sql="UPDATE resource SET viewtimes="&(viewtimes+1)&""
      Conn.execute sql
 end if
session.Timeout=10
 session(userip)=1
%>
                 <div class="view_1"><hr /><span class="view_title"><%=filename %></span></div>
                 <div class="view_1">
                   	<span class=view_tag>课程代号:<%=Server.HTMLEncode(subjectnum)%>;贡献者：<%=Server.HTMLEncode(uploaduser) %>&nbsp;&nbsp;贡献时间：<%=server.HTMLEncode(uploadtime) %>&nbsp;&nbsp;浏览：<%=viewtimes %>次&nbsp;&nbsp;</span>
                  </div>
                   <div class="view_1">
                    <span class="black"> 资料简述 :<%=Server.HTMLEncode(filedesc) %></span>
                  </div>
                  <div class="view_1">
                       <%
                       filetype=trim(filetype)
					   if filetype="dz" then 
					   response.Write("资料所在地点：")
					   end if  
					   if filetype="lj" then
					   response.Write("资料获得链接：")
					   end if 
					   if filetype="wj" then
					   response.Write("资料下载：")
					   end if 
					   %>
                  </div>
                  <div class="view_1">
                       <%
                       filelocation=Server.HTMLEncode(filelocation)
					   if filetype="dz" then 
					   response.Write(filelocation)
					   end if  
					   if filetype="lj" then 
					   response.write("<a href="&filelocation&">"&filelocation&"</a>")
					   end if 
					   if filetype="wj" then 
					   response.Write("<a href=/upload/"&filelocation&" class=ti>请点击下载</a>")
					   end if
					   %>
                  </div>
            </div>
      </div>
      <div class="com_4">
       Copyright@2012 学习资料共享查询系统 v1.0 版权所有 
      </div>
</body>
</html>
